package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingStuMapper;
import com.ruoyi.teaching.domain.TeachingStu;
import com.ruoyi.teaching.service.ITeachingStuService;

/**
 * 学生信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingStuServiceImpl implements ITeachingStuService 
{
    @Autowired
    private TeachingStuMapper teachingStuMapper;

    /**
     * 查询学生信息
     * 
     * @param stuId 学生信息主键
     * @return 学生信息
     */
    @Override
    public TeachingStu selectTeachingStuByStuId(Long stuId)
    {
        return teachingStuMapper.selectTeachingStuByStuId(stuId);
    }

    /**
     * 查询学生信息列表
     * 
     * @param teachingStu 学生信息
     * @return 学生信息
     */
    @Override
    public List<TeachingStu> selectTeachingStuList(TeachingStu teachingStu)
    {
        return teachingStuMapper.selectTeachingStuList(teachingStu);
    }

    /**
     * 新增学生信息
     * 
     * @param teachingStu 学生信息
     * @return 结果
     */
    @Override
    public int insertTeachingStu(TeachingStu teachingStu)
    {
        teachingStu.setCreateTime(DateUtils.getNowDate());
        return teachingStuMapper.insertTeachingStu(teachingStu);
    }

    /**
     * 修改学生信息
     * 
     * @param teachingStu 学生信息
     * @return 结果
     */
    @Override
    public int updateTeachingStu(TeachingStu teachingStu)
    {
        teachingStu.setUpdateTime(DateUtils.getNowDate());
        return teachingStuMapper.updateTeachingStu(teachingStu);
    }

    /**
     * 批量删除学生信息
     * 
     * @param stuIds 需要删除的学生信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingStuByStuIds(Long[] stuIds)
    {
        return teachingStuMapper.deleteTeachingStuByStuIds(stuIds);
    }

    /**
     * 删除学生信息信息
     * 
     * @param stuId 学生信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingStuByStuId(Long stuId)
    {
        return teachingStuMapper.deleteTeachingStuByStuId(stuId);
    }
}
